﻿using System.Web;
using System.Web.Optimization;

namespace SPMS.Web
{
    public class BundleConfig
    {
        // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
        public static void RegisterBundles(BundleCollection bundles)
        {
            //注册JQuery脚本
            bundles.Add(new ScriptBundle("~/Scripts/jquery").Include("~/Scripts/jquery-{version}.js"));

            //注册JQuery验证脚本
            bundles.Add(new ScriptBundle("~/Scripts/jqueryval").Include("~/Scripts/jquery.validate*", "~/Scripts/jquery.validate*"));

            //判断是否为调试版
#if DEBUG
            //注册ExtJS脚本
            bundles.Add(new ScriptBundle("~/Scripts/extjs").Include("~/Scripts/ext-all-debug-{version}.js").Include("~/Scripts/ext-lang-zh_CN.js").Include("~/Scripts/TreePicker.js"));
#else
            //注册ExtJS脚本
            bundles.Add(new ScriptBundle("~/Scripts/extjs").Include("~/Scripts/ext-all-{version}.js").Include("~/Scripts/ext-lang-zh_CN.js").Include("~/Scripts/TreePicker.js"));
#endif

            //注册ExtJS扩展脚本
            bundles.Add(new ScriptBundle("~/Scripts/extjs-extended").Include("~/Scripts/PagingToolbarResizer.js").Include("~/Scripts/PreviewPlugin.js").Include("~/Scripts/Views/ExtJS-Extended.js"));

            //注册系统业务脚本
            bundles.Add(new ScriptBundle("~/Scripts/utility").Include("~/Scripts/Views/Utility.js"));

            //注册业务模型脚本
            bundles.Add(new ScriptBundle("~/Scripts/model").Include("~/Scripts/Views/Model.js"));

            //注册文件上传脚本
            bundles.Add(new ScriptBundle("~/Scripts/swfupload").Include("~/Content/SWFUpload/swfupload.js").Include("~/Content/SWFUpload/plugins/swfupload.cookies.js").Include("~/Content/SWFUpload/plugins/swfupload.queue.js").Include("~/Content/SWFUpload/plugins/swfupload.speed.js").Include("~/Content/SWFUpload/plugins/swfupload.swfobject.js"));

            //注册BootStrap脚本
            bundles.Add(new ScriptBundle("~/Scripts/bootstrap").Include("~/Scripts/bootstrap-{version}.js"));

            //注册ExtJS资源
            bundles.Add(new StyleBundle("~/Content/extjs").Include("~/Content/ExtJS/css/ext-all-gray.css").Include("~/Content/ExtJS/css/ext-patch.css"));

            //注册站点资源
            bundles.Add(new StyleBundle("~/Content/bootstrap").Include("~/Content/Bootstrap/css/bootstrap.css"));

            //注册站点资源
            bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css").Include("~/Content/Patch.css"));
        }
    }
}